<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>maven的配置以及IDEA导入本地maven | Teler的日常</title>
    <meta name="generator" content="VuePress 1.9.9">
    <link rel="icon" href="/img/favicon.ico">
    <meta name="description" content="博客小站，记录我的学习日常和心情等">
    <meta name="keywords" content="前端博客,个人技术博客,前端,前端开发,前端框架,web前端,前端面试题,技术文档,学习,面试,JavaScript,js,ES6,TypeScript,vue,python,css3,html5,Node,git,github,markdown">
    <meta name="baidu-site-verification" content="code-Rpieelje4H">
    <meta name="theme-color" content="#11a8cd">
    
    <link rel="preload" href="/assets/css/0.styles.bb5b1957.css" as="style"><link rel="preload" href="/assets/js/app.d41d74c0.js" as="script"><link rel="preload" href="/assets/js/2.023436e0.js" as="script"><link rel="preload" href="/assets/js/16.08f9cfab.js" as="script"><link rel="prefetch" href="/assets/js/10.f3664957.js"><link rel="prefetch" href="/assets/js/100.98bebc7f.js"><link rel="prefetch" href="/assets/js/101.fe34203c.js"><link rel="prefetch" href="/assets/js/102.ff08e3d5.js"><link rel="prefetch" href="/assets/js/103.7f0f328d.js"><link rel="prefetch" href="/assets/js/104.cf87ee60.js"><link rel="prefetch" href="/assets/js/105.a87694e9.js"><link rel="prefetch" href="/assets/js/106.a478e8b1.js"><link rel="prefetch" href="/assets/js/107.720dff4e.js"><link rel="prefetch" href="/assets/js/108.27f0de33.js"><link rel="prefetch" href="/assets/js/109.f567acfb.js"><link rel="prefetch" href="/assets/js/11.f2e49a76.js"><link rel="prefetch" href="/assets/js/110.9763d4af.js"><link rel="prefetch" href="/assets/js/111.db6527e1.js"><link rel="prefetch" href="/assets/js/112.a20bf841.js"><link rel="prefetch" href="/assets/js/113.fffb90e0.js"><link rel="prefetch" href="/assets/js/114.e10b299e.js"><link rel="prefetch" href="/assets/js/115.73b68794.js"><link rel="prefetch" href="/assets/js/116.a41be574.js"><link rel="prefetch" href="/assets/js/117.f49ddfb7.js"><link rel="prefetch" href="/assets/js/118.f31c49c3.js"><link rel="prefetch" href="/assets/js/119.e7ddd80c.js"><link rel="prefetch" href="/assets/js/12.684abe5a.js"><link rel="prefetch" href="/assets/js/120.ab58a792.js"><link rel="prefetch" href="/assets/js/121.8070a099.js"><link rel="prefetch" href="/assets/js/122.bd4aa83d.js"><link rel="prefetch" href="/assets/js/123.8b28ab66.js"><link rel="prefetch" href="/assets/js/124.c64e8a82.js"><link rel="prefetch" href="/assets/js/125.8c37e25d.js"><link rel="prefetch" href="/assets/js/126.7a965ec1.js"><link rel="prefetch" href="/assets/js/127.15e3f4d7.js"><link rel="prefetch" href="/assets/js/128.92e24736.js"><link rel="prefetch" href="/assets/js/129.376be23d.js"><link rel="prefetch" href="/assets/js/13.f2551a14.js"><link rel="prefetch" href="/assets/js/130.cde8392a.js"><link rel="prefetch" href="/assets/js/131.f7e13266.js"><link rel="prefetch" href="/assets/js/132.a518186c.js"><link rel="prefetch" href="/assets/js/133.d4a43462.js"><link rel="prefetch" href="/assets/js/134.95f419b0.js"><link rel="prefetch" href="/assets/js/135.07df0368.js"><link rel="prefetch" href="/assets/js/136.08277af4.js"><link rel="prefetch" href="/assets/js/137.3c3b9976.js"><link rel="prefetch" href="/assets/js/138.1e1bb8ce.js"><link rel="prefetch" href="/assets/js/139.78d61366.js"><link rel="prefetch" href="/assets/js/14.4fac3ae1.js"><link rel="prefetch" href="/assets/js/15.c4e1a86c.js"><link rel="prefetch" href="/assets/js/17.40f3d3ac.js"><link rel="prefetch" href="/assets/js/18.004165c1.js"><link rel="prefetch" href="/assets/js/19.71a91c37.js"><link rel="prefetch" href="/assets/js/20.be80e063.js"><link rel="prefetch" href="/assets/js/21.dd2e712d.js"><link rel="prefetch" href="/assets/js/22.efedd1da.js"><link rel="prefetch" href="/assets/js/23.b8d5f0c5.js"><link rel="prefetch" href="/assets/js/24.8895cb39.js"><link rel="prefetch" href="/assets/js/25.f72d16f6.js"><link rel="prefetch" href="/assets/js/26.700b8757.js"><link rel="prefetch" href="/assets/js/27.2d888c7a.js"><link rel="prefetch" href="/assets/js/28.c95a06e3.js"><link rel="prefetch" href="/assets/js/29.030c41dc.js"><link rel="prefetch" href="/assets/js/3.ae79ad07.js"><link rel="prefetch" href="/assets/js/30.024d7386.js"><link rel="prefetch" href="/assets/js/31.90222925.js"><link rel="prefetch" href="/assets/js/32.98d886f9.js"><link rel="prefetch" href="/assets/js/33.fdc186c5.js"><link rel="prefetch" href="/assets/js/34.c6364dc9.js"><link rel="prefetch" href="/assets/js/35.90745c1a.js"><link rel="prefetch" href="/assets/js/36.ad08862a.js"><link rel="prefetch" href="/assets/js/37.dec32d64.js"><link rel="prefetch" href="/assets/js/38.3838a6c1.js"><link rel="prefetch" href="/assets/js/39.f4e4d4db.js"><link rel="prefetch" href="/assets/js/4.92869e3b.js"><link rel="prefetch" href="/assets/js/40.5fd3bb13.js"><link rel="prefetch" href="/assets/js/41.51a8fdd5.js"><link rel="prefetch" href="/assets/js/42.82c2e073.js"><link rel="prefetch" href="/assets/js/43.f0ea2a9e.js"><link rel="prefetch" href="/assets/js/44.671c08a7.js"><link rel="prefetch" href="/assets/js/45.5d15b10b.js"><link rel="prefetch" href="/assets/js/46.95005641.js"><link rel="prefetch" href="/assets/js/47.c9ab5796.js"><link rel="prefetch" href="/assets/js/48.43986c57.js"><link rel="prefetch" href="/assets/js/49.08b41247.js"><link rel="prefetch" href="/assets/js/5.5e32f39e.js"><link rel="prefetch" href="/assets/js/50.c11a05b9.js"><link rel="prefetch" href="/assets/js/51.639c8ff2.js"><link rel="prefetch" href="/assets/js/52.df138aff.js"><link rel="prefetch" href="/assets/js/53.39e24743.js"><link rel="prefetch" href="/assets/js/54.f975b5ab.js"><link rel="prefetch" href="/assets/js/55.3ac72402.js"><link rel="prefetch" href="/assets/js/56.ed625cdd.js"><link rel="prefetch" href="/assets/js/57.65af0446.js"><link rel="prefetch" href="/assets/js/58.3468c7f0.js"><link rel="prefetch" href="/assets/js/59.fea7da2c.js"><link rel="prefetch" href="/assets/js/6.3caf43c7.js"><link rel="prefetch" href="/assets/js/60.b978be38.js"><link rel="prefetch" href="/assets/js/61.17791f1f.js"><link rel="prefetch" href="/assets/js/62.3cd7c7e2.js"><link rel="prefetch" href="/assets/js/63.941cd4c6.js"><link rel="prefetch" href="/assets/js/64.7d62a354.js"><link rel="prefetch" href="/assets/js/65.0f35ef90.js"><link rel="prefetch" href="/assets/js/66.c9cd517d.js"><link rel="prefetch" href="/assets/js/67.ed261888.js"><link rel="prefetch" href="/assets/js/68.ab36cb55.js"><link rel="prefetch" href="/assets/js/69.e43a29c4.js"><link rel="prefetch" href="/assets/js/7.49459967.js"><link rel="prefetch" href="/assets/js/70.9c465e47.js"><link rel="prefetch" href="/assets/js/71.10344edd.js"><link rel="prefetch" href="/assets/js/72.9b399737.js"><link rel="prefetch" href="/assets/js/73.11e18677.js"><link rel="prefetch" href="/assets/js/74.9ab52ddf.js"><link rel="prefetch" href="/assets/js/75.15e0a627.js"><link rel="prefetch" href="/assets/js/76.433e942f.js"><link rel="prefetch" href="/assets/js/77.6f9979c4.js"><link rel="prefetch" href="/assets/js/78.c2cb7a93.js"><link rel="prefetch" href="/assets/js/79.7fc614fb.js"><link rel="prefetch" href="/assets/js/8.32c107dd.js"><link rel="prefetch" href="/assets/js/80.c75ae340.js"><link rel="prefetch" href="/assets/js/81.1d958700.js"><link rel="prefetch" href="/assets/js/82.9df67712.js"><link rel="prefetch" href="/assets/js/83.b3454e49.js"><link rel="prefetch" href="/assets/js/84.425e9e1a.js"><link rel="prefetch" href="/assets/js/85.d59ea930.js"><link rel="prefetch" href="/assets/js/86.4bdd04a1.js"><link rel="prefetch" href="/assets/js/87.121c124e.js"><link rel="prefetch" href="/assets/js/88.5a75898f.js"><link rel="prefetch" href="/assets/js/89.b87b375d.js"><link rel="prefetch" href="/assets/js/9.59e8ac2a.js"><link rel="prefetch" href="/assets/js/90.e51756a8.js"><link rel="prefetch" href="/assets/js/91.f8cae4b0.js"><link rel="prefetch" href="/assets/js/92.81b133ff.js"><link rel="prefetch" href="/assets/js/93.8350bd06.js"><link rel="prefetch" href="/assets/js/94.2d121b75.js"><link rel="prefetch" href="/assets/js/95.ef51b143.js"><link rel="prefetch" href="/assets/js/96.7d2163d3.js"><link rel="prefetch" href="/assets/js/97.a3cbbfc7.js"><link rel="prefetch" href="/assets/js/98.5ddb1d6b.js"><link rel="prefetch" href="/assets/js/99.5b21b4a2.js">
    <link rel="stylesheet" href="/assets/css/0.styles.bb5b1957.css">
  </head>
  <body class="theme-mode-light">
    <div id="app" data-server-rendered="true"><div class="theme-container have-rightmenu have-body-img"><header class="navbar blur"><div title="目录" class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><img src="/img/logo.png" alt="Teler的日常" class="logo"> <span class="site-name can-hide">Teler的日常</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="索引" class="dropdown-title"><a href="/archives/" class="link-title">索引</a> <span class="title" style="display:none;">索引</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/" class="nav-link">分类</a></li><li class="dropdown-item"><!----> <a href="/tags/" class="nav-link">标签</a></li><li class="dropdown-item"><!----> <a href="/archives/" class="nav-link">归档</a></li></ul></div></div><div class="nav-item"><a href="/about/" class="nav-link">关于</a></div> <a href="https://github.com/fangweilong" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar-hover-trigger"></div> <aside class="sidebar" style="display:none;"><div class="blogger"><img src="/img/logo.png"> <div class="blogger-info"><h3>Teler</h3> <span>Day Day Up</span></div></div> <nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">首页</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="索引" class="dropdown-title"><a href="/archives/" class="link-title">索引</a> <span class="title" style="display:none;">索引</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/categories/" class="nav-link">分类</a></li><li class="dropdown-item"><!----> <a href="/tags/" class="nav-link">标签</a></li><li class="dropdown-item"><!----> <a href="/archives/" class="nav-link">归档</a></li></ul></div></div><div class="nav-item"><a href="/about/" class="nav-link">关于</a></div> <a href="https://github.com/fangweilong" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>mybatis</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>lambda</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>maven</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/pages/311460/" class="sidebar-link">maven-dependencyManagement子模块不写版本号无法引入</a></li><li><a href="/pages/979573/" class="sidebar-link">maven-install提示找不到pom</a></li><li><a href="/pages/4d5bc9/" aria-current="page" class="active sidebar-link">maven的配置以及IDEA导入本地maven</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_1-maven安装前先确定你本地的jdk是否安装-环境变量是否配置" class="sidebar-link">1.maven安装前先确定你本地的jdk是否安装，环境变量是否配置</a></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_2-maven的官网-点击打开官网" class="sidebar-link">2.maven的官网:点击打开官网</a></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_3-下载后解压-我用的是解压版-建议自定义目录-将所有开发中需要用到的例如jdk-idea等都放入同一个文件夹中-这样好找并且好管理。一定要记住你的目录-并且不要出现各种奇怪的字符或者中文-不然出现各种问题哭都来不及" class="sidebar-link">3.下载后解压（我用的是解压版），建议自定义目录，将所有开发中需要用到的例如jdk,idea等都放入同一个文件夹中，这样好找并且好管理。一定要记住你的目录！！！并且不要出现各种奇怪的字符或者中文，不然出现各种问题哭都来不及</a></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_4-配置maven的环境变量" class="sidebar-link">4.配置maven的环境变量</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header level3"><a href="/pages/4d5bc9/#_5-打开cmd-输入命令" class="sidebar-link">5. 打开cmd,输入命令</a></li></ul></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_6-修改maven的仓库位置-这一步没有需求的可以跳过直接看第7步-不是必需步骤" class="sidebar-link">6.修改maven的仓库位置（这一步没有需求的可以跳过直接看第7步，不是必需步骤）</a></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_7-修改镜像地址" class="sidebar-link">7.修改镜像地址</a></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_8-下载基础包" class="sidebar-link">8.下载基础包</a></li><li class="sidebar-sub-header level2"><a href="/pages/4d5bc9/#_9-idea2017-3-1配置maven" class="sidebar-link">9.idea2017.3.1配置maven</a></li></ul></li><li><a href="/pages/1b457a/" class="sidebar-link">maven添加ojdbc6(11g)的jar包</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>算法</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>spring boot</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>spring cloud</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>jsp</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>tomcat</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>cloudflare</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/pages/bf5f65/" class="sidebar-link">bootdo框架使用步骤总结</a></li><li><a href="/pages/f3e09f/" class="sidebar-link">filter拦截器获取http请求参数</a></li><li><a href="/pages/3ac4b1/" class="sidebar-link">java-String字符串split分割无效</a></li><li><a href="/pages/f38461/" class="sidebar-link">java表单提交，调用doNet的webservice乱码</a></li><li><a href="/pages/669f30/" class="sidebar-link">java访问webservice</a></li><li><a href="/pages/22420c/" class="sidebar-link">Long返回给前台在js中丢失精度</a></li><li><a href="/pages/a5eb49/" class="sidebar-link">MongoDB查询</a></li><li><a href="/pages/d31b31/" class="sidebar-link">NoSuchMethodError</a></li><li><a href="/pages/4589a8/" class="sidebar-link">PropertyNotFoundException</a></li><li><a href="/pages/311841/" class="sidebar-link">使用java生成微信随机加好友的链接</a></li><li><a href="/pages/6e84e0/" class="sidebar-link">连接chrome调试</a></li></ul> </aside> <div><main class="page"><div class="theme-vdoing-wrapper bg-style-1"><div class="articleInfo-wrap" data-v-06225672><div class="articleInfo" data-v-06225672><ul class="breadcrumbs" data-v-06225672><li data-v-06225672><a href="/" title="首页" class="iconfont icon-home router-link-active" data-v-06225672></a></li> <li data-v-06225672><a href="/categories/?category=java" title="分类" data-v-06225672>java</a></li><li data-v-06225672><a href="/categories/?category=maven" title="分类" data-v-06225672>maven</a></li></ul> <div class="info" data-v-06225672><div title="作者" class="author iconfont icon-touxiang" data-v-06225672><a href="https://github.com/fangweilong" target="_blank" title="作者" class="beLink" data-v-06225672>Teler</a></div> <div title="创建时间" class="date iconfont icon-riqi" data-v-06225672><a href="javascript:;" data-v-06225672>2018-01-22</a></div> <!----></div></div></div> <!----> <div class="content-wrapper"><div class="right-menu-wrapper"><div class="right-menu-margin"><div class="right-menu-title">目录</div> <div class="right-menu-content"></div></div></div> <h1><img src="">maven的配置以及IDEA导入本地maven<!----></h1>  <div class="theme-vdoing-content content__default"><h2 id="_1-maven安装前先确定你本地的jdk是否安装-环境变量是否配置"><a href="#_1-maven安装前先确定你本地的jdk是否安装-环境变量是否配置" class="header-anchor">#</a> 1.maven安装前先确定你本地的jdk是否安装，环境变量是否配置</h2> <hr> <h2 id="_2-maven的官网-点击打开官网"><a href="#_2-maven的官网-点击打开官网" class="header-anchor">#</a> 2.maven的官网:<a href="http://maven.apache.org/download.cgi" target="_blank" rel="noopener noreferrer">点击打开官网<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></h2> <hr> <h2 id="_3-下载后解压-我用的是解压版-建议自定义目录-将所有开发中需要用到的例如jdk-idea等都放入同一个文件夹中-这样好找并且好管理。一定要记住你的目录-并且不要出现各种奇怪的字符或者中文-不然出现各种问题哭都来不及"><a href="#_3-下载后解压-我用的是解压版-建议自定义目录-将所有开发中需要用到的例如jdk-idea等都放入同一个文件夹中-这样好找并且好管理。一定要记住你的目录-并且不要出现各种奇怪的字符或者中文-不然出现各种问题哭都来不及" class="header-anchor">#</a> 3.下载后解压（我用的是解压版），建议自定义目录，将所有开发中需要用到的例如jdk,idea等都放入同一个文件夹中，这样好找并且好管理。一定要记住你的目录！！！并且不要出现各种奇怪的字符或者中文，不然出现各种问题哭都来不及</h2> <hr> <h2 id="_4-配置maven的环境变量"><a href="#_4-配置maven的环境变量" class="header-anchor">#</a> 4.配置maven的环境变量</h2> <div class="language- extra-class"><pre><code>系统变量：
MAVEN_HOME = 你的maven路径

用户变量：
path = %MAVEN_HOME%\bin
</code></pre></div><hr> <h3 id="_5-打开cmd-输入命令"><a href="#_5-打开cmd-输入命令" class="header-anchor">#</a> 5. 打开cmd,输入命令</h3> <div class="language-cmd line-numbers-mode"><pre class="language-text"><code>	mvn -version
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><img src="https://img-blog.csdn.net/20180122194742713?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdHV0aWFuMjAwMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt=""></p> <p>在这里我们可以看到maven的一些参数，如果有出现这个就不用管，说明我们初始的maven配置成功了</p> <hr> <h2 id="_6-修改maven的仓库位置-这一步没有需求的可以跳过直接看第7步-不是必需步骤"><a href="#_6-修改maven的仓库位置-这一步没有需求的可以跳过直接看第7步-不是必需步骤" class="header-anchor">#</a> 6.修改maven的仓库位置（这一步没有需求的可以跳过直接看第7步，不是必需步骤）</h2> <div class="language- extra-class"><pre><code>  找到maven/conf/settings.xml(不是.m2文件夹下的,两个有何不同请看文章结尾)，我的是在D:\Server\maven\conf\settings.xml
</code></pre></div><img src="https://img-blog.csdn.net/20180122195555425?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdHV0aWFuMjAwMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt=""> <p>找到这一行，按照你自己设置的文件夹的填入地址，以后maven下载的包都会在这个路径下，而不是在C:\Users\admcnm.m2\repository的默认文件夹下面</p> <hr> <h2 id="_7-修改镜像地址"><a href="#_7-修改镜像地址" class="header-anchor">#</a> 7.修改镜像地址</h2> <img src="https://img-blog.csdn.net/20180122200049294?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdHV0aWFuMjAwMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt=""> <p>还是在settings.xml文件中，找到如图所在的位置，添加或修改红框框起来的内容</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>&lt;mirror&gt;
	&lt;id&gt;nexus-aliyun&lt;id&gt;
	&lt;mirrorOf&gt;*&lt;mirrorOf&gt;
	&lt;name&gt;Nexus aliyun&lt;name&gt;
	&lt;url&gt;http://maven.aliyun.com/nexus/content/groups/public&lt;url&gt;
&lt;mirror&gt;
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p>修改完以后我们下载jar包都是在阿里云的镜像中下载，而不是国外的地址，速度会快很多</p> <hr> <h2 id="_8-下载基础包"><a href="#_8-下载基础包" class="header-anchor">#</a> 8.下载基础包</h2> <p>在cmd中输入命令并执行：</p> <div class="language-cmd line-numbers-mode"><pre class="language-text"><code>mvn help:system
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p>如果此时出现下载各种包，那么maven的基础配置就完成。但是如果你和我一样出现了这种问题</p> <div class="language- line-numbers-mode"><pre class="language-text"><code>[ERROR] Error executing Maven.
[ERROR] 3 problems were encountered while building the effective settings
[WARNING] Unrecognised tags: 'activeProfiles' (position: START_TAG seen ...\u4e0d\u5230\u8fd9\u6837\u4e00\u4e2aprofile\uff0cMaven\u5219\u4f1a\u50cf\u5f80\u5e38\u4e00\u6837\u8fd0\u884c\u3002  --;  \r\n            ;activeProfiles;... @288:29)  @ C:\Users\Administrator\.m2\settings.xml, line 288, column 29
[ERROR] 'profiles.profile[test].pluginRepositories.pluginRepository.id' for  is missing @ C:\Users\Administrator\.m2\settings.xml
[ERROR] 'profiles.profile[test].pluginRepositories.pluginRepository.url' for  is missing @ C:\Users\Administrator\.m2\settings.xml
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p>那么删除你
C:\Users\用户名.m2\settings.xml文件后再试。</p> <hr> <h2 id="_9-idea2017-3-1配置maven"><a href="#_9-idea2017-3-1配置maven" class="header-anchor">#</a> 9.idea2017.3.1配置maven</h2> <img src="https://img-blog.csdn.net/20180122201319636?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdHV0aWFuMjAwMA==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast"> <hr> <ul><li>.m2文件下的settings.xml文件是我们这台电脑当前登录用户使用的自定义配置文件，其他maven文件中的setting.xml是全局配置文件，当用户配置文件和全局配置文件都存在时系统会默认先使用用户的配置文件，我个人习惯使用全局配置文件，同一路径下好管理，与其他人共同使用时也好统一。*</li></ul></div></div>  <div class="page-edit"><div class="edit-link"><a href="https://github.com/fangweilong/edit/master/docs/01.java/03.maven/03.maven的配置以及IDEA导入本地maven.md" target="_blank" rel="noopener noreferrer">编辑</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <div class="tags"><a href="/tags/?tag=java" title="标签">#java</a><a href="/tags/?tag=maven" title="标签">#maven</a></div> <div class="last-updated"><span class="prefix">上次更新:</span> <span class="time">2024-12-06, 10:03:39</span></div></div> <div class="page-nav-wapper"><div class="page-nav-centre-wrap"><a href="/pages/979573/" class="page-nav-centre page-nav-centre-prev"><div class="tooltip">maven-install提示找不到pom</div></a> <a href="/pages/1b457a/" class="page-nav-centre page-nav-centre-next"><div class="tooltip">maven添加ojdbc6(11g)的jar包</div></a></div> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/pages/979573/" class="prev">maven-install提示找不到pom</a></span> <span class="next"><a href="/pages/1b457a/">maven添加ojdbc6(11g)的jar包</a>→
      </span></p></div></div></div> <div class="article-list"><div class="article-title"><a href="/archives" class="iconfont icon-bi">最近更新</a></div> <div class="article-wrapper"><dl><dd>01</dd> <dt><a href="/pages/4ab140/"><div>
            利用cf大善人的 pages+AI gateway 搭建自己的AI平台
            <!----></div></a> <span class="date">12-06</span></dt></dl><dl><dd>02</dd> <dt><a href="/pages/104183/"><div>
            java playwright爬虫
            <!----></div></a> <span class="date">11-06</span></dt></dl><dl><dd>03</dd> <dt><a href="/pages/bdcbb5/"><div>
            连接chrome调试
            <!----></div></a> <span class="date">07-23</span></dt></dl> <dl><dd></dd> <dt><a href="/archives" class="more">更多文章&gt;</a></dt></dl></div></div></main></div> <div class="footer"><div class="icons"><a href="fangweilong@outlook.com" title="发邮件" target="_blank" class="iconfont icon-youjian"></a><a href="https://github.com/fangweilong" title="GitHub" target="_blank" class="iconfont icon-github"></a></div> 
  Theme by
  <a href="https://github.com/xugaoyi/vuepress-theme-vdoing" target="_blank" title="本站主题">Vdoing</a> 
    | Copyright © 2021-2024
    <span> Teler 版权所有 | 我的博客小站。欢迎评论OR转发！</span></div> <div class="buttons"><div title="返回顶部" class="button blur go-to-top iconfont icon-fanhuidingbu" style="display:none;"></div> <div title="去评论" class="button blur go-to-comment iconfont icon-pinglun" style="display:none;"></div> <div title="主题模式" class="button blur theme-mode-but iconfont icon-zhuti"><ul class="select-box" style="display:none;"><li class="iconfont icon-zidong">
          跟随系统
        </li><li class="iconfont icon-rijianmoshi">
          浅色模式
        </li><li class="iconfont icon-yejianmoshi">
          深色模式
        </li><li class="iconfont icon-yuedu">
          阅读模式
        </li></ul></div></div> <div class="body-bg" style="background:url() center center / cover no-repeat;opacity:0.5;"></div> <!----> <!----></div><div class="global-ui"><div></div><canvas id="vuepress-canvas-cursor"></canvas><div></div></div></div>
    <script src="/assets/js/app.d41d74c0.js" defer></script><script src="/assets/js/2.023436e0.js" defer></script><script src="/assets/js/16.08f9cfab.js" defer></script>
  </body>
</html>
